package cn.z2huo.knowledge.collection;

import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

/**
 * <p>
 *
 * @author z2huo
 */
@Slf4j
class Test implements Serializable {

    public static void main(String[] args) {
        List<String> list = new ArrayList<String>();
        Optional.ofNullable(list.getFirst()).orElseThrow(() -> new RuntimeException("第一个元素为空"));
        System.out.println(list.getFirst());
        System.out.println(list.get(0));
        System.out.println("");
        log.info("就是");
        log.info("就是");
        System.out.println("");
        System.out.println("就是");
    }

}
